<extend name="common" />
<block name="main">
<div class="bd">
  <div class="sign-lists">
    <ul class="nav nav-tabs">
      <if condition="$filter.status eq ''">
      <li class="active"><a href="{:U('Home/Index/signManage')}">全部</a></li>
      <else />
      <li><a href="{:U('Home/Index/signManage')}">全部</a></li>
      </if>
      <if condition="$filter.status eq progress">
      <li class="active"><a href="{:U('Home/Index/signManage',['status'=>'progress'])}">待审核</a></li>
      <else />
      <li><a href="{:U('Home/Index/signManage',['status'=>'progress'])}">待审核</a></li>
      </if>
      <if condition="$filter.status eq success">
      <li class="active"><a href="{:U('Home/Index/signManage',['status'=>'success'])}">已通过</a></li>
      <else />
      <li><a href="{:U('Home/Index/signManage',['status'=>'success'])}">已通过</a></li>
      </if>
      <if condition="$filter.status eq fail">
      <li class="active"><a href="{:U('Home/Index/signManage',['status'=>'fail'])}">已拒绝</a></li>
      <else />
      <li><a href="{:U('Home/Index/signManage',['status'=>'fail'])}">已拒绝</a></li>
      </if>
    </ul>
      <table class="table table-striped table-hover table-signlist">
          <thead>
              <tr>
                  <td>所属项目</td>
                  <td>提交人</td>
                  <td>提交时间</td>
                  <td>状态</td>
                  <td>审核人</td>
                  <td>审核时间</td>
                  <td>操作</td>
              </tr>
          </thead>
          <tbody>
            <foreach name="sign_applys" item="apply">
              <tr>
                  <td>{$apply.project_name}</td>
                  <td>{$apply.creator}</td>
                  <td>{$apply.create_time}</td>
                  <td>{$apply.status}</td>
                  <td>{$apply.operator}</td>
                  <td>{$apply.operate_time}</td>
                  <td>
                    <a class="btn btn-xs  btn-default btn-detail" href="{:U('Home/Index/applyDetail',['apply_id'=>$apply['apply_id']])}"><i class="glyphicon glyphicon-eye-open"></i>&nbsp;详情/审核</a>
                    <a class="btn btn-xs btn-danger btn-delete" href="javascript:;" onclick="deleteApply({$apply[apply_id]})"><i class="glyphicon glyphicon-remove"></i>&nbsp;&nbsp;删除</a>
                  </td>
              </tr>
            </foreach>
          </tbody>
      </table>
      <if condition="$page['count'] neq 0">
      <ul class="pagination pull-right">
          <if condition="$page['current'] eq 1">
          <li class="disabled"><a href="javascript:;">&laquo;</a></li>
          <else />
          <li><a href="{:U('Home/Index/signManage',['status'=>$filter['status'],'page_no'=>$page['current']-1])}">&laquo;</a></li>
          </if>
          <for start="1" end="$page['count'] + 1" step="1" name="page_no" >
          <if condition="$page_no eq $page['current']">
          <li class="active"><a href="{:U('Home/Index/signManage',['status'=>$filter['status'],'page_no'=>$page_no])}">{$page_no}</a></li>
          <else />
          <li><a href="{:U('Home/Index/signManage',['status'=>$filter['status'],'page_no'=>$page_no])}">{$page_no}</a></li>
          </if>
          </for>
          <if condition="$page['current'] egt $page['count']">
          <li class="disabled"><a href="javascript:;">&raquo;</a></li>
          <else />
          <li><a href="{:U('Home/Index/signManage',['status'=>$filter['status'],'page_no'=>$page['current']+1])}">&raquo;</a></li>
          </if>
      </ul>
      </if>
  </div>
</div>
<script>
function deleteApply(apply_id){
  if(confirm('确定要这么做吗？')){
    var url = "{:U('Home/Index/deleteApply')}";
    $.post(url,{apply_id:apply_id},function(rs){
      if(rs.success){
        showMessage('success',rs.msg,rs.url);
      }
      else{
        showMessage('erroe',rs.msg,rs.url);
      }
    });
  }
}
</script>
</block>